package com.andaily.domain.log;

import com.andaily.domain.shared.Repository;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author Shengzhao Li
 */
public interface LogRepository extends Repository {

    void saveLog(Log log);

    Log findByGuid(String guid);

    void saveLogType(LogType logType);

    LogType findLogTypeByGuid(String guid);

    void saveLogComment(LogComment logComment);

    LogComment findLogCommentByGuid(String guid);

    List<LogType> findAvailableLogTypes(String userGuid);

    void updateLog(Log log);

    List<Log> findLogs(Map<String, Object> params);

    int totalLogs(Map<String, Object> params);

    int totalAvailableLogs();

    List<LogType> findLogTypes(Map<String, Object> params);

    int totalLogTypes(Map<String, Object> params);

    int countOfLogType(String logTypeGuid);

    void updateLogType(LogType logType);

    void archiveLogType(@Param("guid") String guid, @Param("archived") boolean archived);

    void archiveLog(@Param("guid") String guid, @Param("archived") boolean archived);

    void archiveLogComment(@Param("guid") String guid, @Param("archived") boolean archived);

    void updateLogSetting(@Param("allowRecordPosition") boolean allowRecordPosition, @Param("guid") String guid);

    Boolean findAllowRecordPosition(String userGuid);

    void cancelAllSelectedTypes(String userGuid);

    void updateSelectLogType(@Param("userGuid") String userGuid, @Param("guid") String guid);

    void saveAuditLog(AuditLog log);

    void saveScheduleLog(ScheduleLog log);
}
